import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dk_form/flutter_dk_form.dart';
import 'package:dk_flutter_base/dk_ui.dart';
class PageButtonDemoWidget extends StatefulWidget {
  static const String routeName = '/page/button_demo_page';
  static const String name = "Button Demo";

  @override
  State<StatefulWidget> createState() {
    return PageButtonDemoWidgetState();
  }
}

class PageButtonDemoWidgetState extends State<PageButtonDemoWidget> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text("Button Demo")),
        body: Column(
          children: <Widget>[
            Text('大圆角按钮'),
            ButtonWidget(
              width: 343,
              height: 44,
              borderRadius: BorderRadius.all(Radius.circular(22),),
              title: '定金协议',
              onTap: () {
                print('定金协议');
              },
            ),
            Text('两个按钮吸底'),
            BottomButtonWidget(),
            Text('任意个按钮吸底'),
            BottomButtonsWidget(getButtons(context)),
          ],
        ));
  }

  List<Widget> getButtons(BuildContext context) {
    List<Widget> list = List();
    list.add(Expanded(
      child: Padding(
        padding: EdgeInsets.only(right: 9),
        child: ButtonWidget(
          backGroundColor: Colors.white,
          titleColor: Color(0xffF88D7F),
          title: '定金协议',
          onTap: () {
//            showToast('ssss');
            print('定金协议');
          },
        ),
      ),
    ));
    list.add(Expanded(
      child: Padding(
        padding: EdgeInsets.only(left: 5, right: 5),
        child: ButtonWidget(
          title: '支付订单',
          onTap: () {
            print('支付订单');
          },
        ),
      ),
    ));
    list.add(Expanded(
      child: Padding(
        padding: EdgeInsets.only(left: 9),
        child: ButtonWidget(
          backGroundColor: Colors.white,
          titleColor: Color(0xff3DBCC6),
          title: '去支付',
          onTap: () {
            print('去支付');
          },
        ),
      ),
    ));
    return list;
  }
}
